package com.android.graffiti;

import android.graphics.PointF;

import java.util.ArrayList;
import java.util.List;

/**
 * 模拟{@link android.graphics.Path}记录操作路径<br>
 * Created by edward on 17-6-23.
 */

public class CustomPath {
    private List<PointF> mPointList;

    public CustomPath() {
        mPointList = new ArrayList<>();
    }

    public void addPoint(PointF point) {
        mPointList.add(point);
    }

    public int size() {
        return mPointList.size();
    }

    public PointF getPointAt(int i) {
        if (i >= mPointList.size() || i < 0) {
            return new PointF(0, 0);
        }
        return mPointList.get(i);
    }
    public void clear() {
        mPointList.clear();
    }

}
